<!DOCTYPE html>
<html>
<head>
<include file="Include:meta" />
<title>财务费用统计(按周期)-目的地运营集团数据管理平台</title>
<include file="Include:style" />
    <style>
        .schedule{ width: 100%;background-color: #f6f6f6}
        .thead-style th{font-size:12px;text-align: center; background: #232f3f; color: #fff; font-weight: normal;}
        .thead-style th span{ line-height: 20px; display: block; }
        .date span{ vertical-align: middle; }
        .schedule td{ height: 100px; }
        th.line{ padding: 0 !important; height: 41px; }
        th.line svg{ position: absolute; width: 100%; left: 0; top: 0; }
        th.line span{ position: absolute; bottom: 5px; left: 5px; }
        th.line em{ position: absolute; top: 0px; right: 5px; }
        .rel{ position: relative; height: 100% }
    </style>
</head>
<body>
<include file="Include:header" />
<include file="Include:left" />
<div id="main">
	<div class="crumbs">
		<div class="crumbs-text">财务费用统计(按周期)</div>
		<div class="right">
			<div class="input-group left w250">
		    	<input type="text" id="keyword" value="{$keyword}" class="form-control" placeholder="按费用归属人搜索" autocomplete="off">
	    		<span class="input-group-btn">
	        		<button class="btn found_btn" type="button">搜索</button>
		    	</span>
		    </div>
		</div>
	</div>
	<div id="content">
		<div class="filter">
			<div class="filter-item">
				<div class="filter-title">申请类型：</div>
				<ul class="filter-order">
					<li <if condition="$type eq -10">class="current"</if>>
						<a href="__APP__/Financial/cost_list_statistics/keyword/{$keyword}/type/-10/stage/{$stage}/year/{$year}">全部</a>
					</li>
					<li <if condition="$type eq 1">class="current"</if>>
						<a href="__APP__/Financial/cost_list_statistics/keyword/{$keyword}/type/1/stage/{$stage}/year/{$year}">差旅费报销申请</a>
					</li>
					<li <if condition="$type eq 2">class="current"</if>>
						<a href="__APP__/Financial/cost_list_statistics/keyword/{$keyword}/type/2/stage/{$stage}/year/{$year}">费用报销单</a>
					</li>
					<li <if condition="$type eq 3">class="current"</if>>
						<a href="__APP__/Financial/cost_list_statistics/keyword/{$keyword}/type/3/stage/{$stage}/year/{$year}">付款申请</a>
					</li>
					<li <if condition="$type eq 4">class="current"</if>>
						<a href="__APP__/Financial/cost_list_statistics/keyword/{$keyword}/type/4/stage/{$stage}/year/{$year}">营销专项费用报销申请</a>
					</li>
					<li <if condition="$type eq 5">class="current"</if>>
						<a href="__APP__/Financial/cost_list_statistics/keyword/{$keyword}/type/5/stage/{$stage}/year/{$year}">营销专项付款申请</a>
					</li>
				</ul>
			</div>
			<if condition="$type eq 3">
                <div class="filter-item">
                    <div class="filter-title">付款类型：</div>
                    <ul class="filter-order">
                        <li <if condition="$c_type eq -10">class="current"</if>>
                        <a href="__APP__/Financial/cost_list_statistics/keyword/{$keyword}/type/{$type}/c_type/-10/stage/{$stage}/year/{$year}">全部</a>
                        </li>
                        <foreach name="cost_list" item="vo">
                            <li <if condition="$c_type eq $vo['name1']">class="current"</if>>
                            <a href="__APP__/Financial/cost_list_statistics/keyword/{$keyword}/type/{$type}/c_type/{$vo['name1']}/stage/{$stage}/year/{$year}">{$vo['name1']}</a>
                            </li>
                        </foreach>
                    </ul>
                </div>
            </if>
            <if condition="$type neq -10">
                <div class="filter-item">
                    <div class="filter-title">费用类型：</div>
                    <ul class="filter-order">
                        <li <if condition="$f_type eq -10">class="current"</if>>
                        <a href="__APP__/Financial/cost_list_statistics/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/f_type/-10/stage/{$stage}/year/{$year}">全部</a>
                        </li>
                        <foreach name="fcost_list" item="vo">
                            <li <if condition="$f_type eq $vo['name1']">class="current"</if>>
                            <a href="__APP__/Financial/cost_list_statistics/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/f_type/{$vo['name1']}/stage/{$stage}/year/{$year}">{$vo['name1']}</a>
                            </li>
                        </foreach>
                    </ul>
                </div>
			</if>
			<div class="filter-item">
				<div class="filter-title">筛选方式：</div>
				<ul class="filter-order">
					<li <if condition="$stage eq 1">class="current"</if>>
						<a href="__APP__/Financial/cost_list_statistics/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/stage/1/year/{$year}">按中心</a>
					</li>
					<li <if condition="$stage eq 2">class="current"</if>>
						<a href="__APP__/Financial/cost_list_statistics/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/stage/2/year/{$year}">按公司</a>
					</li>
				</ul>
			</div>
			<div class="filter-item">
                <span style="vertical-align:middle">周期筛选：</span>
                <select name="year" class="form-control" style="width: 80px">
                    <foreach name="year_list" item="vo">
                        <option value="{$vo}"<if condition="$vo eq $year"> selected</if>>{$vo}</option>
                    </foreach>
                </select>
                年
			</div>
		</div>
		<div class="table-scrollx">
            <table class="table table-bordered table-hover">
                <tbody>
                <tr class="thead-style text-center">
                    <th class="line" width="6%"><div class="rel"><span><if condition="$stage eq 1">所属中心<else />所属公司</if></span><em>月份</em>
                        <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><line x1="0" y1="0" x2="100%" y2="100%" stroke="white" stroke-width="1"/></svg></div>
                    </th>
                    <th width="7%">一月</th>
                    <th width="7%">二月</th>
                    <th width="7%">三月</th>
                    <th width="7%">四月</th>
                    <th width="7%">五月</th>
                    <th width="7%">六月</th>
                    <th width="7%">七月</th>
                    <th width="7%">八月</th>
                    <th width="7%">九月</th>
                    <th width="7%">十月</th>
                    <th width="7%">十一月</th>
                    <th width="7%">十二月</th>
                    <th width="7%">合计</th>
                </tr>
                <if condition="$center_list eq NULL">
                    <tr>
                        <td colspan="14" class="text-center">暂无相关内容</td>
                    </tr>
                </if>
                <foreach name="center_list" id="key" item="vo">
                    <tr>
						<if condition="$stage eq 1">
							<td>{$vo['first_name']}</td>
							<foreach name="vo['sum_total']" key="k" item="v">
								<td>
									<if condition="!empty($v)">
										<if condition="$k eq 12">
											<a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/stage/{$stage}/start/{$year}-01-01/end/{:date($year.'-12-31')}" target="_blank">{:floatval($v)}</a>
											<else />
											<a href="__APP__/Financial/cost_list/keyword/{$keyword}/center_id/{$vo['id']}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/stage/{$stage}/start/<if condition='$k elt 8'>{$year}-0{$k+1}-01<else />{$year}-{$k+1}-01</if>/end/{:date('Y-m-t',strtotime($year.'-'.($k+1).'-01'))}" target="_blank">{:floatval($v)}</a>
										</if>
									</if>
								</td>
							</foreach>
						<else />
							<td>{$vo['ascription_unit']}</td>
							<foreach name="vo['sum_total']" key="k" item="v">
								<td>
									<if condition="!empty($v)">
										<if condition="$k eq 12">
											<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/stage/{$stage}/start/{$year}-01-01/end/{:date($year.'-12-31')}" target="_blank">{:floatval($v)}</a>
											<else />
											<a href="__APP__/Financial/cost_list/keyword/{$keyword}/company/{$vo['ascription_unit']}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/stage/{$stage}/start/<if condition='$k elt 8'>{$year}-0{$k+1}-01<else />{$year}-{$k+1}-01</if>/end/{:date('Y-m-t',strtotime($year.'-'.($k+1).'-01'))}" target="_blank">{:floatval($v)}</a>
										</if>
									</if>
								</td>
							</foreach>
						</if>
                    </tr>
                </foreach>
				<tr>
					<td><strong>总计</strong></td>
					<foreach name="total" item="vv" key="kk">
						<td>
							<if condition="!empty($vv['total'])">
								<a href="__APP__/Financial/cost_list/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/stage/{$stage}/start/<if condition='$kk elt 8'>{$year}-0{$kk+1}-01<else />{$year}-{$kk+1}-01</if>/end/{:date('Y-m-t',strtotime($year.'-'.($kk+1).'-01'))}" target="_blank">{:floatval($vv['total'])}</a>
							</if>
						</td>
					</foreach>
				</tr>
                </tbody>
            </table>
		</div>
	</div>
</div>
<include file="Include:javascript" />
<script type="text/javascript">
$(function(){
	//搜索
	$(".found_btn").keywordSearch("__APP__/Financial/cost_list_statistics/keyword/$keyword/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/stage/{$stage}/year/{$year}");
	
    $(document).on("change","[name='year']",function(){
        var val = $(this).val();
        window.location.href="__APP__/Financial/cost_list_statistics/keyword/{$keyword}/type/{$type}/c_type/{$c_type}/f_type/{$f_type}/stage/{$stage}/year/"+val;
    });
});
</script>
</body>
</html>